import React from 'react';
import { Redirect } from 'react-router-dom';
import { notification } from 'antd';
const Auth = (props: any) => {
  const isLogin = true;
  if (!isLogin && props.path !== '/login') {
    notification.info({
      message: ``,
      description: '登录过期，请重新登录',
    });
    return <Redirect to='/login' />;
  } else {
    return <>{props.children}</>;
  }
};

export default Auth;
